{defun name="myList" list=$categories}
{foreach from=$list item=node}
	{if $node.childs ne false}
		<option value="{$node.id}" {if $node.selected}selected{/if}><b>{$node.title}</b></option>
		<span>---</span>{fun name="myList" list=$node.sub}
	{else}
		<option value="{$node.id}" {if $node.selected}selected{/if}>{$node.title}</option>
	{/if}
{/foreach}
{/defun}